View Issue Details

IDProjectCategoryView StatusLast Update
0001748K18X001.00 SKB SWANSWpublic2023-06-20 16:06
Reporter(ALTech) Sangmin Choi Assigned To(ALTech) Sangmin Choi Due Date2023-06-23 16:23
PrioritynormalSeveritys4-minorReproducibilityN/A
Status closedResolutionfixed 
Summary0001748: Please apply this patch from CSMSKBSBLT-211.
DescriptionHi, Jason,

Please apply this patch from CSMSKBSBLT-211.
You can apply them to 540 branches.

1.
vendor/synaptics/vsxxx
SKBSBALT-144-Set_pcm_output_when_nugu_on.patch
Commit Message : storing current audio output then changing audio output format as PCM when NUGU is on.
When NUGU is off, rollback audio output as stored value.

2.
syna-release/ampsdk
revert below commit
commit 807533d5fb88d14a9a3ed770992f5fe36508626f (tag: BFX-UA300_5.3.1_2021-0825-122743, tag: BFX-UA300_5.3.1_2021-0825-122603, tag: BFX-UA300_5.3.1_2021-0825-120722, tag: BFX-UA300_5.3.1_2021-0823-122720, tag: BFX-UA300_5.3.1_2021-0823-120637, tag: BFX-UA300_5.3.1_2021-0823-100051, tag: BFX-UA300_5.3.1_2021-0819-192525, tag: BFX-UA300_5.3.1_2021-0819-192349, tag: BFX-UA300_5.3.1_2021-0813-122409, tag: BFX-UA300_5.3.1_2021-0813-121848)
Author: Tony Kim <Tony.Kim@synaptics.com>
Date: Wed Aug 11 23:30:30 2021 +0900

    SKB-144 Nugu patch

Thank you.
Sangmin Choi.
TagsNo tags attached.
Attach Tags

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

(ALTech) Sangmin Choi

2023-06-20 15:30

developer  

SKBSBALT-144-Set_pcm_output_when_nugu_on.patch (3,079 bytes)   
diff --git a/audio/audio_hw.cpp b/audio/audio_hw.cpp
index 7678423..7ecfa1f 100755
--- a/audio/audio_hw.cpp
+++ b/audio/audio_hw.cpp
@@ -83,6 +83,11 @@ struct pcm_config pcm_config_in = {
 };
 #endif
 
+/* store previous audio format for nugu_playback */
+static AMP_SND_SPDIF_FORMAT gSpdifFormat = AMP_SND_SPDIF_FORMAT_INVALID;
+static AMP_SND_HDMI_FORMAT gHdmiFormat = AMP_SND_HDMI_FORMAT_INVALID;
+
+
 static uint32_t out_get_sample_rate(const struct audio_stream *stream)
 {
     ENTER("stream=%p", stream);
@@ -1219,6 +1224,26 @@ static int adev_set_parameters(struct audio_hw_device *dev,
 			gDevConStatus.nugu_playback_enabled = true;
 			bAudioRouteChange = true;
 
+                        // save audio format
+                        AMP_SND_GetSpdifFormat(&gSpdifFormat);
+                        AMP_SND_GetHDMIFormat(&gHdmiFormat);
+
+                        // set output mode as PCM or PCM multi when nugu is on
+                        if(gHdmiFormat != AMP_SND_HDMI_FORMAT_PCM_MULTI) {
+                            ret = AMP_SND_SetSpdifFormat(AMP_SND_SPDIF_FORMAT_STEREO_PCM);
+                            if( ret != SUCCESS ) {
+                                MVLOGE("fail to set AMP_SND_SetSpdifFormat() to AMP_SND_SPDIF_FORMAT_STEREO_PCM!!!");
+                            } else {
+                                MVLOGD("change to Spdif format to PCM.");
+                            }
+                            ret = AMP_SND_SetHDMIFormat(AMP_SND_HDMI_FORMAT_PCM_MULTI);
+                            if( ret != SUCCESS ) {
+                                MVLOGE("fail to set AMP_SND_SetHDMIFormat () to AMP_SND_HDMI_FORMAT_PCM_MULTI!!!");
+                            } else {
+                                MVLOGD("change to HDMI format to PCM.");
+                            }
+                        }
+
 			//Enable AMP when NUGU is playing.
 			isAmpOn = property_get_int32(PROPERTY_VENDOR_AMP_STATUS, 1);
 			if(isAmpOn == 0){ //AMP is off
@@ -1237,6 +1262,22 @@ static int adev_set_parameters(struct audio_hw_device *dev,
 			//Fii add end; River 2022/07/17
 			gDevConStatus.nugu_playback_enabled = false;
 			bAudioRouteChange = true;
+
+                        // Change output format as saved one.
+                        if(gHdmiFormat != AMP_SND_HDMI_FORMAT_INVALID) {
+                        ret = AMP_SND_SetSpdifFormat(gSpdifFormat);
+                        if( ret != SUCCESS ) {
+                            MVLOGE("fail to set AMP_SND_SetSpdifFormat() to (%d)!!!", gSpdifFormat);
+                        } else {
+                            MVLOGD("change to Spdif format to (%d).", gSpdifFormat);
+                        }
+                        ret = AMP_SND_SetHDMIFormat(gHdmiFormat);
+                        if( ret != SUCCESS ) {
+                            MVLOGE("fail to set AMP_SND_SetHDMIFormat () to (%d)!!!", gHdmiFormat);
+                        } else {
+                            MVLOGD("change to HDMI format to (%d).", gHdmiFormat);
+                        }
+                    }
 		}
 	}
 

(SW) Jason Ling

2023-06-20 15:54

developer   ~0013470

Hi Sangmin,

Done,

2023-06-20 15:54:06 | jason.tf.ling@fii-.. | 41d769f1 | syna-release/ampsdk | Revert "SKB-144 Nugu patch"
2023-06-20 15:51:00 | jason.tf.ling@fii-.. | bea26dd | vendor/synaptics/vsxxx | storing current audio output then changing audio output format

Thanks,
Jason

(ALTech) Sangmin Choi

2023-06-20 16:06

developer   ~0013471

Dear Jason,

Thank you!

Issue History

Date Modified Username Field Change
2023-06-20 15:30 (ALTech) Sangmin Choi New Issue
2023-06-20 15:30 (ALTech) Sangmin Choi Status new => assigned
2023-06-20 15:30 (ALTech) Sangmin Choi Assigned To => (SW) Jason Ling
2023-06-20 15:30 (ALTech) Sangmin Choi File Added: SKBSBALT-144-Set_pcm_output_when_nugu_on.patch
2023-06-20 15:54 (SW) Jason Ling Assigned To (SW) Jason Ling => (ALTech) Sangmin Choi
2023-06-20 15:54 (SW) Jason Ling Status assigned => resolved
2023-06-20 15:54 (SW) Jason Ling Note Added: 0013470
2023-06-20 16:06 (ALTech) Sangmin Choi Note Added: 0013471
2023-06-20 16:06 (ALTech) Sangmin Choi Status resolved => closed
2023-06-20 16:06 (ALTech) Sangmin Choi Resolution open => fixed